#pragma once 

class Obj;

// The game has one ObjContainer which owns all game objects
// class is used for rendering and picking
// possibly other 'global' simulations that use all game objects
// Independent of players, player army only point to objects held by the container 

class ObjContainer 
{
public:
	static ObjContainer* getInstance();
		
	Obj* colorPick(FBO_RB pickingFBO, const glm::dvec2& mousePos);
	void addObj(Obj* obj);
	void draw(const glm::mat4& viewMatrix, bool picking = false);
	void update(float dt);
	bool walkable(const glm::vec2 & pos, float radius);
	
private:
	Obj* getObjFromColor(const glm::vec4& color);

	std::vector<Obj*> objList;
	std::vector<Obj*> addsScheduled;
	
	ObjContainer();
	static ObjContainer* instance;
};
